Skip to content

Add standalone create_probs_histogram() prediction distribution adapt… - #417

Closed
uriahf wants to merge 4 commits into
mainfrom
feat/standalone-create-probs-histogram-8470295566618691985
Closed

uriahf wants to merge 4 commits into
mainfrom
feat/standalone-create-probs-histogram-8470295566618691985

Conversation

@uriahf

@uriahf uriahf commented Sep 13, 2026

Copy link
Copy Markdown
Owner

…er and vendor rtichoke_viz v0.22.0

  • Vendor rtichoke_viz v0.22.0 release asset (SHA-256 64087fe0284ab2beb6e664dd419504a56000e217eaf403f33559896b67fff94d).
  • Implement _prediction_distribution_v2_spec_from_performance_data in _viz_spec_v2.py to construct canonical v0.22.0 PredictionDistributionSpec objects.
  • Implement standalone public create_probs_histogram() function in probs_distribution.py and export in rtichoke package namespace.
  • Update RtichokeBrowserChart to support single-file self-contained HTML rendering for prediction distribution charts.
  • Add deterministic unit tests and Playwright real-browser acceptance tests.

…er and vendor rtichoke_viz v0.22.0

- Vendor rtichoke_viz v0.22.0 release asset (SHA-256 64087fe0284ab2beb6e664dd419504a56000e217eaf403f33559896b67fff94d).
- Implement _prediction_distribution_v2_spec_from_performance_data in _viz_spec_v2.py to construct canonical v0.22.0 PredictionDistributionSpec objects.
- Implement standalone public create_probs_histogram() function in probs_distribution.py and export in rtichoke package namespace.
- Update RtichokeBrowserChart to support single-file self-contained HTML rendering for prediction distribution charts.
- Add deterministic unit tests and Playwright real-browser acceptance tests.

Co-authored-by: uriahf <11351434+uriahf@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://uriahf.github.io/rtichoke_python/pr-preview/pr-417/

Built to branch gh-pages at 2026-09-13 14:17 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@uriahf

uriahf commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

Thanks — the overall implementation, v0.22.0 adoption, public API, join keys,
self-contained rendering, and test coverage look good. CI is green.

Before merging, please make one architectural correction so this consumer can
be reused cleanly by the upcoming Summary Report integration.

  1. Split the current canonical builder into two layers.

The lowest-level shared builder should accept already-prepared inputs, along
the lines of:

_prediction_distribution_v2_spec(
    distribution_data,
    performance_data,
    evaluation_metadata,
)

It must only map those producer-owned quantities into the canonical
PredictionDistributionSpec. It must not call statistical producers.

The public standalone path may then use a convenience wrapper that calls:

_prepare_probs_distribution_data(...)
prepare_performance_data(...)
_build_evaluation_metadata(...)

and passes their outputs to the shared prepared-data builder.

The current function is named
_prediction_distribution_v2_spec_from_performance_data(), but it accepts raw
probs/reals and calculates performance internally. This prevents Summary
Reports from reusing their already-prepared threshold performance data and
would cause unnecessary repeated producer calls.

Do not change statistical behavior or the public create_probs_histogram() API.

  1. Correct the PPCR wording in the public docstring.

Replace:

“Positive Predicted Value / Positive Rate”

with the established package terminology:

“Predicted Positives Condition Rate”

Risk Percentile may remain as the user-facing explanatory label.

  1. Preserve confusion-matrix counts as Python integers.

Serialize true_positives, true_negatives, false_positives, and false_negatives
with int(...) rather than through the generic float conversion helper.
Continuous metrics should remain floats, and undefined estimates should remain
None/null.

Add focused tests proving:

  • the prepared-data builder does not call either statistical producer;
  • the public wrapper and prepared-data builder produce the same canonical spec;
  • TP/TN/FP/FN estimates are integers;
  • undefined continuous metrics remain None/null.

Keep Summary Report integration out of this PR. Do not merge yet.

google-labs-jules Bot and others added 3 commits September 13, 2026 13:17
…ndardize confusion matrix integer serialization

- Refactor _prediction_distribution_v2_spec to accept pre-computed distribution_data, performance_data, and evaluation_metadata without calling statistical producers.
- Retain _prediction_distribution_v2_spec_from_performance_data as a convenience wrapper over raw inputs.
- Preserve confusion matrix counts (true_positives, true_negatives, false_positives, false_negatives) as Python integers in serialized operating points performance estimates.
- Correct PPCR docstring wording in create_probs_histogram() to 'Predicted Positives Condition Rate'.
- Add focused tests verifying non-invocation of statistical producers by the low-level builder, spec parity between wrapper and low-level builder, integer confusion matrix types, and None/null serialization for undefined continuous metrics.

Co-authored-by: uriahf <11351434+uriahf@users.noreply.github.com>
…tarball verification

Update the wheel package verification assertion in .github/workflows/python-package.yml to check for rtichoke-viz-0.22.0.tar.gz instead of the superseded 0.20.2 tarball.

Co-authored-by: uriahf <11351434+uriahf@users.noreply.github.com>
…er and vendor rtichoke_viz v0.22.0

- Vendor rtichoke_viz v0.22.0 release asset (SHA-256 64087fe0284ab2beb6e664dd419504a56000e217eaf403f33559896b67fff94d).
- Implement two-layer PredictionDistributionSpec builder (_prediction_distribution_v2_spec and _prediction_distribution_v2_spec_from_performance_data) in _viz_spec_v2.py.
- Export public create_probs_histogram() function in probs_distribution.py with boundary validation and Predicted Positives Condition Rate docstring terminology.
- Update RtichokeBrowserChart to support single-file self-contained HTML rendering for prediction distribution charts.
- Update .github/workflows/quarto-acceptance.yml and .github/workflows/python-package.yml for browser acceptance and wheel verification.
- Add deterministic unit tests, authoritative JSON schema validation tests, negative contract tests, and Playwright real-browser acceptance tests.

Co-authored-by: uriahf <11351434+uriahf@users.noreply.github.com>
uriahf added a commit that referenced this pull request Sep 14, 2026
…ogram-8470295566618691985-5908255235920094156

Update PR #417 to published rtichoke_viz v0.22.1 release artifact
@uriahf

uriahf commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #418, which contains the same standalone Prediction Distribution implementation together with the final published rtichoke_viz v0.22.1 artifact.

@uriahf uriahf closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant